#include<bits/stdc++.h>
#define int long long
#define ls(x) ((x)*2)
#define rs(x) ((x)*2+1)
#define Debug(...) fprintf(stderr, __VA_ARGS__)
#define For(i,a,b) for(int i=a,i##end=b;i<=i##end;i++)
#define Rof(i,a,b) for(int i=a,i##end=b;i>=i##end;i--)
#define rep(i,  b) for(int i=1,i##end=b;i<=i##end;i++)
using namespace std;
const int N=5e5+5,Mod=1e9+7;
//char buf[(1<<21)+5],*p1,*p2;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
void chmx(int &x,int y){(x<y)&&(x=y);}
void chmn(int &x,int y){(x>y)&&(x=y);}
typedef __int128_t i128;
i128 _base=1;
inline int mol(int x){return x-Mod*(_base*x>>64);}
inline void Add(int &x,int y){x=mol(x+y+Mod);}
inline int read(){
	int f=0,x=0;
	char ch=getchar();
	while(!isdigit(ch)){f|=(ch=='-');ch=getchar();}
	while(isdigit(ch)){x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}
	return f?-x:x;
}
int n,m,x;
char s[N];
int y=0;
int dp[2005][33][33];
int gg[N],tot;
inline int ksm(int a,int b){
	if(b<0) return 0;
	int res=1;
	while(b){
		if(b&1) res=res*a%Mod;
		a=a*a%Mod;
		b>>=1;
	}
	return res;
}
signed main(){
	_base=(_base<<64)/Mod;
	freopen("pearl.in","r",stdin);
	freopen("pearl.out","w",stdout);
	n=read(),m=read(),x=read();
	scanf("%s",s+1);
	int p=1;
	For(i,1,m){
		y+=(s[i]=='1')*p;
		p=p*2;
	}
	if(n<=1000){
		
		dp[0][0][0]=1;
		For(i,1,n)
			For(j,0,p-1)
				For(t,0,p-1){
					if(!dp[i-1][j][t])continue;
					For(k,0,p-1)
						if(i!=x||k==y)(dp[i][k][(t^(j*k))%p]+=dp[i-1][j][t])%=Mod;
				}
		int ans=0;
		For(j,0,p-1){
			For(t,0,p-1){
				ans+=dp[n][j][t]*t%Mod;ans%=Mod;
				//cout<<j<<" "<<t<<" "<<dp[n][j][t]<<endl;
			}
		}
		printf("%lld\n",ans%Mod);
		return 0;
	}
	if(x==1&&y==0&&m==1){
		n--;
		printf("%lld\n",(ksm(2,n-1)-ksm(2,n-n/2-1)+Mod)%Mod);
	}
#ifdef LOCAL
    Debug("\nMy Time: %.3lfms\n", (double)clock() / CLOCKS_PER_SEC);
#endif
	return 0;
}
/*
602 1 1
0
*/
